home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / sci_calc / ucalc32.zip / UCALC.DOC < prev    next >
Text File  |  1996-11-21  |  66KB  |  1,686 lines

  1.     =======================================================================
  2.     
  3.                        ULTIMATE CALCULATOR (UCALC) 3.2
  4.                    Copyright (C) 1992-1996 by Daniel Corbier
  5.                              All Rights Reserved.
  6.     
  7.     =======================================================================
  8.     
  9.     
  10.     CONTENTS
  11.     --------
  12.     
  13.     1.  Introduction
  14.     2.  UCALC Features
  15.     3.  Getting Started
  16.         3.1 Installation
  17.         3.2 Single Calculations at the DOS Prompt
  18.         3.3 Interactive Calculations
  19.         3.4 Popping UCALC up with a Hot Key
  20.             3.4.1 Memory
  21.             3.4.2 Swap file
  22.             3.4.3 Hot Key
  23.             3.4.4 Extra Memory
  24.             3.4.5 Text Buffer
  25.             3.4.6 Resizing and Moving the Window
  26.     4.  UCALC Prompt
  27.     5.  Table of Symbols
  28.     6.  Order of Precedence
  29.     7.  Flexible Syntax
  30.     8.  GRAPHING
  31.         8.1 How to Plot
  32.             8.1.1 Cartesian
  33.             8.1.2 Parametric
  34.             8.1.3 Polar
  35.             8.1.4 3D Surface
  36.             8.1.5 Plotting data from another file
  37.             8.1.6 Line Segment
  38.             8.1.7 Rectangle
  39.             8.1.8 Filling an Area
  40.         8.2 Graph Menu
  41.             8.2.1 [F2] Reset
  42.             8.2.2 [F3] Fill
  43.             8.2.3 [F4] Color
  44.             8.2.4 [F5] Grid/Axis
  45.             8.2.5 [F6] Dot/Connect
  46.             8.2.6 [F7] Trace
  47.             8.2.7 [F8] Mono
  48.             8.2.8 [F9] Zoom In
  49.             8.2.9 [F10] Zoom Out
  50.         8.3 Special Graphing Commands
  51.             8.3.1 AUTOCLR (automatic coloring)
  52.             8.3.2 AXIS (sets axis line color)
  53.             8.3.3 CONNECT (toggle for dot/connect)
  54.             8.3.4 GCOLOR (background color in graphic mode)
  55.             8.3.5 GRID (sets grid color & pattern)
  56.             8.3.6 MODE (selects graphic card)
  57.             8.3.7 MONO (turns colors off)
  58.             8.3.8 PLOTF (sends the graph coordinates to a file)
  59.             8.3.9 PPLOT (edits previously plotted equations)
  60.             8.3.10 PREC (sets graph precision)
  61.             8.3.11 WINDOW (sets screen coordinate system)
  62.             8.3.12 ZOOM (changes zoom factor)
  63.         8.4 Moving the Crosshair
  64.         8.5 Adding Text to the Screen
  65.         8.6 Printing a Graphic Screen
  66.     9.  Summation
  67.     10. Numerical Integration
  68.     11. Solving Equations
  69.     12. Numerical Notations
  70.     13. Implicit Multiplication
  71.     14. Assigning Variables
  72.     15. Assigning Functions
  73.     16. Miscellaneous Commands
  74.         16.1 LOAD
  75.         16.2 WRITE
  76.         16.3 SHELL
  77.         16.4 COLOR
  78.         16.5 REDIRECT
  79.     17. UCALC.DEF
  80.     18. Technical Notes
  81.     19. Registration
  82.     20. Shareware Author & User Case Study
  83.     21. My Address
  84.     22. Distribution
  85.     23. Acknowledgments
  86.     
  87.     
  88.     1.  Introduction
  89.         ============
  90.     
  91.     UCALC is a graphing scientific calculator which can be used for simple
  92.     arithmetic, or intricate scientific calculations.  It supports many
  93.     built-in functions, operators, numerical notations, and modes.  It also
  94.     supports user-defined functions and variables.  It can evaluate
  95.     expressions, solve equations, plot equations, perform numerical
  96.     integrations, do summations, and more.  UCALC can optionally be
  97.     loaded as a TSR taking less than 6K of main memory.  Expressions
  98.     such as the following are accepted:
  99.  
  100.         63 - 5 + 4.75
  101.     
  102.         (5.9-abs(2.8/5-3))^2 + sin( 3-(pi+3/4)*myfunction(a,b) )
  103.     
  104.         solve 3*x^2+2*x-5 = 27 
  105.     
  106.         #b101010 and (#b10101 or #h1CC) * 2^5
  107.     
  108.         plot sin(x)*x^2/10
  109.  
  110.         plot3d sin(x)*z
  111.     
  112.     
  113.     2.  UCALC Features
  114.         ==============
  115.  
  116.     - MATH EXPRESSION EVALUATOR for simple or intricate operations
  117.     - Arithmetic, bitwise, and relational operators
  118.     - Decimal, hexadecimal, binary and octal notations
  119.     - Trig, hyperbolic, and many other common scientific functions
  120.     - Supports user defined variables & functions with multiple arguments
  121.     - Radian, degree, and gradient modes for trig functions
  122.     - High precision: 18 significant digits.  +/-3.4E-4932 to +/-1.2E+4932
  123.     - Equation solver, summation & sumtable, numerical integration
  124.  
  125.     - POP UP WITH A HOT KEY
  126.     - Window can be resized or moved
  127.     - Hot key combination can be chosen
  128.     - Less than 6K main memory using EMS or file
  129.     - Main memory, EMS, or file, can be chosen for swapping
  130.     - PASTE command
  131.     - TSR can be unloaded from memory
  132.  
  133.     - FAST EQUATION PLOTTER
  134.     - Interactive menu with ZOOM, TRACE, COLOR, FILL, GRID, etc...
  135.     - Support for up to 16 supper-imposed multi-color user graphs
  136.     - Cartesian (rectangular), polar, and parametric user graphs
  137.     - 3D surface plotting with hidden line removal
  138.     - Data from another file can be plotted
  139.     - Adjustable precision & screen coordinate system
  140.     - Text can be typed anywhere on the graph screen
  141.     - VGA, EGA, MCGA, CGA, and Hercules modes (auto detection or select)
  142.     - Coordinates can be saved to a file
  143.     - Mouse support
  144.  
  145.     - Online help with F1
  146.     - Line editor with expression recall
  147.     - Expressions can be entered at the DOS command line
  148.     - Support for DOS redirection
  149.     - Adjustable FIX & DIG notation
  150.     - LOAD, WRITE, PRINT, SHELL, COLOR, and more
  151.     
  152.     
  153.     3.  Getting Started
  154.         ===============
  155.     
  156.         3.1 Installation
  157.             ------------
  158.     
  159.     There is no elaborate procedure for installing UCALC.  Simply type
  160.     UCALC to run the program.  To customize UCALC, simply create or modify
  161.     the UCALC.DEF and UCALC.TSR text files (explained further down). 
  162.     UCALC.EXE, UCALC.DEF, and UCALC.TSR can be placed in a directory
  163.     defined in the PATH statement of the AUTOEXEC.BAT file (such as the DOS
  164.     or UTILS directory), for easier access.  
  165.     
  166.     
  167.         3.2 Single Calculations at the DOS Prompt
  168.             -------------------------------------
  169.     
  170.     There are several ways of running the Ultimate Calculator.  The first
  171.     way is to enter an expression at the DOS command line as follows:
  172.     
  173.     UCALC 5+4*8/2 [enter]
  174.     
  175.     At the DOS command line, UCALC will accept the following options:
  176.     
  177.     /?        Help
  178.     /TSR      Loads UCALC as a memory resident program
  179.     /NODEF    Ignores UCALC.DEF
  180.     
  181.     UCALC also supports redirection from the DOS command line.
  182.     
  183.     If an expression is present at the command line, it is evaluated, and
  184.     control returns to DOS.  If redirection is performed, control also
  185.     returns to DOS when finished.  Otherwise, it goes to the 'ucalc> '
  186.     prompt, where you may enter many expressions and quit with [Esc].  If a
  187.     symbol in the expression is in conflict with DOS, then enclose the
  188.     expression in quotes.
  189.     
  190.     Examples:
  191.     ---------
  192.     
  193.     UCALC 3+6-2
  194.     
  195.     UCALC "5^4 | 5*8"
  196.     
  197.     UCALC /NODEF 3+7
  198.     
  199.     UCALC < abc.cal > output.uc
  200.     
  201.     
  202.         3.3 Interactive Calculations
  203.             ------------------------
  204.     
  205.     UCALC also provides a line editor for performing multiple calculations.
  206.     This environment allows you to assign values to variables, and define
  207.     functions as you go along.  To run UCALC in that mode, simply type
  208.     "UCALC" at the DOS command line without any expression as follows:
  209.     
  210.     UCALC [enter]
  211.     
  212.     When you are in this mode, you can press [F1] any time for help, and
  213.     [Esc] to quit the program.  See EXAMPLES.DOC to get more ideas on how
  214.     to use UCALC.  For a graphing demo, enter   PLOTDEMO   from the
  215.     DOS prompt.
  216.     
  217.  
  218.         3.4 Popping UCALC up with a Hot Key
  219.             -------------------------------
  220.     
  221.     A third way of running UCALC is to first load it as a TSR file.  From
  222.     then on, UCALC can be called instantly at any time with a hot key,
  223.     without the user having to go to the DOS prompt.
  224.     
  225.     To load UCALC as a TSR program, simply type this at the DOS prompt:
  226.     
  227.     UCALC /TSR
  228.     
  229.     Or, include that line in your AUTOEXEC.BAT file.  Once UCALC is memory
  230.     resident, it can be invoked at any time with a hot key such as "ALT U". 
  231.     Before running UCALC as a TSR for the first time, check the parameters
  232.     in UCALC.TSR to make sure they match your needs.  
  233.     
  234.     The presence of a UCALC.TSR file is optional.  In the absence of this
  235.     file, the parameters are set as follows:
  236.     
  237.     MEMORY=E/F
  238.     SWAPFILE=C:\UCALC$.$$$
  239.     HOTKEY=ALT U
  240.     EXTRAMEM=11000
  241.     TEXTBUFF=15
  242.     
  243.     The following parameters can be set in UCALC.TSR:
  244.     
  245.     
  246.             3.4.1 Memory
  247.                   ------
  248.     
  249.     The following line sets how UCALC is loaded into memory as a TSR:
  250.     
  251.     MEMORY=<option>
  252.     
  253.     where <option> is one of the following:
  254.     
  255.            EMS
  256.     If your computer has EMS memory, then this is the best option.  It
  257.     takes less then 6K of main memory, and pops up quickly when invoked.
  258.     
  259.            MAIN
  260.     If this option is chosen, UCALC will pop up quickly when invoked, but
  261.     it will also take a lot of bytes from main memory.
  262.     
  263.            FILE
  264.     This option takes up less then 6K of main memory, but instead of
  265.     swapping to EMS or using up main memory, it swaps to a file.  With this
  266.     option, it generally takes more time for UCALC to pop up when invoked. 
  267.     When using this option, make sure that there is at least 350Kb free on
  268.     the hard drive.  Do not use this option on a floppy drive, as it would
  269.     be painfully slow, and it would crash if the disk were removed when
  270.     popping up.  If the FILE option is chosen, a file must be defined with
  271.     "SWAPFILE=".
  272.     
  273.            E/F
  274.     If the "MEMORY=" line is omitted, or if E/F is entered, then UCALC will
  275.     use EMS if detected or it will swap to a file if there's no EMS.
  276.     
  277.  
  278.             3.4.2 Swap file
  279.                   ---------
  280.     
  281.     If a line with "MEMORY=FILE" is used, then a swap file must be defined
  282.     as follows:
  283.     
  284.     SWAPFILE=<filename>
  285.     
  286.     The file name must include the drive letter, and path; for instance
  287.     "SWAPFILE=C:\UCALC$.$$$".  Choose a name that is unique, and unlikely
  288.     to be used for something else.  To protect the user from accidentally
  289.     erasing this file, it is marked with a hidden attribute.  The swapfile
  290.     parameter is ignored if UCALC loads into EMS or main memory.
  291.     
  292.     
  293.             3.4.3 Hot Key
  294.                   -------
  295.     
  296.     By default UCALC is popped up by pressing <ALT U>.  This can however be
  297.     changed by placing a line in UCALC.TSR with the following format:
  298.     
  299.     HOTKEY=<CTRL and/or ALT and/or SHIFT> <character>
  300.     
  301.     The following lines are examples of acceptable hot keys:
  302.     
  303.     HOTKEY=ALT 1
  304.     HOTKEY=CTRL V
  305.     HOTKEY=CTRL ALT Z
  306.     
  307.     
  308.             3.4.4 Extra Memory
  309.                   ------------
  310.     
  311.     When UCALC is loaded from DOS without the TSR option, memory is
  312.     allocated dynamically.  This means that as new variables and functions
  313.     are being defined, etc... additional main memory is being taken. 
  314.     However, when UCALC is loaded as a TSR, a fixed maximum amount of
  315.     memory is allocated (which is generally much less than what is
  316.     available when running it as a non-TSR).  This amount can be raised or
  317.     lowered with the following line:
  318.     
  319.     EXTRAMEM=<number>
  320.     
  321.     <number> should be greater than 8000.  Anything less may cause UCALC to
  322.     run out of memory even for simple calculations.
  323.     
  324.     
  325.             3.4.5 Text Buffer
  326.                   -----------
  327.  
  328.     This determines how many lines of text can be recalled.  When run from
  329.     DOS, 100 lines can be recalled.  To conserve memory in TSR mode, the
  330.     number of lines that can be recalled should be reduced.  This is done
  331.     by adding this line.
  332.  
  333.     TEXTBUFF=<number>
  334.  
  335.     Where <number> is between 2 and 100.
  336.  
  337.             3.4.6 Resizing and Moving the Window
  338.                   ------------------------------
  339.  
  340.     <Ctrl> Up, Down, Left, or Right arrow is used for moving the window.
  341.     <Alt> Up, Down, Left, or Right changes the window size.
  342.  
  343.     NOTE:  When resizing the window, do not use the arrows on the numeric
  344.            keypad, since <Alt> <keypad number> is used for returning
  345.            ASCII characters.  Use the other arrows instead.
  346.  
  347.  
  348.     4.  UCALC Prompt
  349.         ============
  350.  
  351.     At the 'ucalc> ' prompt, expressions to be evaluated can be entered,
  352.     functions and variables can be defined, and the following commands and
  353.     function keys can be used:
  354.     
  355.     [F1] Help                   (same as HELP or ?)
  356.     [F2] Lists variables        (same as LIST)
  357.     [F3] Displays UCALC.DEF     (same as LIST DEF)
  358.     [F4] DOS shell              (same as SHELL)
  359.     [F5] Lists user functions   (same as LISTF)
  360.     [Esc] Quit                  (same as QUIT, see also EXIT)
  361.     
  362.     AUTOCLR [nn]             Sets the number of colors used in graphing.
  363.     AXIS color               Changes the color of the graphic axis lines.
  364.     CLOSE                    Closes the file opened with the WRITE command.
  365.     CLS                      Clears the screen.
  366.     COLOR [foregr] [,backg]  Changes the text screen colors.
  367.     CONNECT {ON|OFF}         Toggles connected/dotted graphs.
  368.     DIG nn                   Changes the total number of digits displayed.
  369.     EXIT                     Exits to DOS (or pops down if in TSR mode).
  370.     EXIT TSR                 Exits, and de-activates UCALC from memory.
  371.     FIX nn                   Changes number of decimal digits displayed.
  372.     GCOLOR color             Changes graph screen background color.
  373.     GRID color [, pattern]   Sets the grid pattern in the graph mode.
  374.     HELP                     Gives online help (same as F1 or ?).
  375.     INTEG fx,a..b [,n]       Numerical integration.
  376.     LIST                     Lists user defined variables (same as F2).
  377.     LISTF                    Lists user defined functions (same as F5).
  378.     LIST DEF                 Displays the contents of UCALC.DEF (F3).
  379.     LOAD"filename"           Loads a file.
  380.     MODE {DEG|RAD|GRA}       Changes mode to degree, radian, or gradient.
  381.     MODE {HGC|CGA|EGA|VGA|MCGA}   Sets the graphic mode for plotting.
  382.     MODE HBO                 Toggles the hex, binary, octal answer display.
  383.     MONO                     Turns graphic mode colors off.
  384.     MOUSE [ON|OFF]           Toggles mouse support for graphs.
  385.     PASTE                    Places result on screen after popping down.
  386.     PLOT [equation]          Plots user equations (2D).
  387.     PLOT3D [equation]        Plots a 3d user equation f(x,z).
  388.     PPLOT                    Edits previously plotted equations (2D).
  389.     PREC nn                  Changes the precision used in graphing.
  390.     PRINT [ON|OFF]           Prints the current session as you work.
  391.     PROMPT"yourprompt"       Changes or removes the 'ucalc> ' prompt.
  392.     PROMPTA"yourprompt"      Changes or removes the 'Answer: ' prompt.
  393.     QUIT                     Exits (same as [Esc]).
  394.     REDIRECT [ON|OFF]        Enables or disables redirection.
  395.     SHELL                    Shells to DOS (same as F4).
  396.     SHELL"command"           Executes a DOS command.
  397.     SOLVE fx [=gx] [,a..b]   Solves an equation.
  398.     SUM fx,a..b [,dx]        Summation of function fx ranging from a to b.
  399.     SUMTABLE fx,a..b [,dx]   Summation which displays intermediate results.
  400.     WINDOW(x1,x2,y1,y2)      Changes the screen coordinate system.
  401.     WRITE"filename"          Records your session to a file.
  402.     ZOOM nn                  Changes the zoom factor.
  403.     
  404.     The variable 'last' contains the value of the previous computation.
  405.     Variable 'x' is the parameter which should be used with SUM, SUMTABLE,
  406.     and SOLVE.  Selections which appear inside brackets [] are optional.
  407.     
  408.     At the 'ucalc> ' prompt, the up (or down) arrow keys can be used to
  409.     recall previous expressions.  Several characters may be keyed in before
  410.     pressing the up arrow in order to recall an expression starting with
  411.     those characters.
  412.     
  413.     
  414.     5.  Table of Symbols
  415.         ================
  416.     
  417.     Symbol   Equivalent   Description                       Example
  418.     ------   ----------   -----------                       -------
  419.     ( )                   Prioritizes an expression         5*(1+1) = 10
  420.     
  421.     !                     Factorial                              5! = 120
  422.     ^        **           Raised to the power of            4  ^  5 = 1024
  423.     *                     Multiply by                       3  *  6 = 18
  424.     /                     Divide by                         9  /  2 = 4.5
  425.     %        MOD          Modulo                            7  %  4 = 3
  426.     +                     Add                               1  +  1 = 2
  427.     -                     Subtract                          9  -  5 = 4
  428.     
  429.     >                     Greater than                      9  >  2 = 1
  430.     <                     Less than                         7  <  4 = 0
  431.     =        ==           Equal test                        5  =  4 = 0
  432.     >=       =>           Greater or equal                  3  >= 3 = 1
  433.     <=       =<           Less or equal                   $3E  <= 9 = 0
  434.     <>                    Not Equal                   #b10101 <> 20 = 1
  435.     
  436.     NOT                   Bitwise 'not'                     not(15) = -16
  437.     AND       &           Bitwise 'and'              #b101 and #h1E = 4
  438.     OR        |           Bitwise 'or'                     13 or 6  = 15
  439.     XOR                   Bitwise 'exclusive or'           9 xor 3  = 10
  440.     EQV                   Bitwise 'equivalence'            6 eqv 9  = -16
  441.     IMP                   Bitwise 'implication'            1 imp 5  = -1
  442.     
  443.     SIN                   Sine                              sin(pi) = 0
  444.     COS                   Cosine                            cos(pi) = -1
  445.     TAN                   Tangent                           tan(pi) = 0
  446.     ASIN                  Arcsine                           asin(1) = 1.570
  447.     ACOS                  Arccosine                        acos(-1) = 3.141
  448.     ATAN      ATN         Arctangent                        atan(0) = 0
  449.     
  450.     SINH                  Hyperbolic sine                   sinh(3) = 10.01
  451.     COSH                  Hyperbolic cosine                 cosh(2) = 3.762
  452.     TANH                  Hyperbolic tangent                tanh(1) = 0.761
  453.     COTH                  Hyperbolic cotangent              coth(1) = 1.318
  454.     SECH                  Hyperbolic secant                 sech(0) = 1
  455.     CSCH                  Hyperbolic cosecant               csch(1) = 0.850
  456.     ASINH                 Hyperbolic arcsine               asinh(2) = 1.443
  457.     ACOSH                 Hyperbolic arccosine             acosh(9) = 2.887
  458.     ATANH                 Hyperbolic arctangent           atanh(.5) = 1.098
  459.     ACOTH                 Hyperbolic arccotangent          acoth(7) = 0.143
  460.     ASECH                 Hyperbolic arcsecant            asech(.3) = 1.873
  461.     ACSCH                 Hyperbolic arccosecant           acsch(2) = 0.481
  462.     
  463.     ABS                   Absolute value                    abs(-8) = 8
  464.     EXP                   e to the power of                  exp(3) = 20.08
  465.     RND                   Random number                      rnd(1) = .9686
  466.     INT                   Truncate to an integer           int(6.8) = 6
  467.     CEIL                  Round upward                    ceil(6.8) = 7
  468.     EXP2                  2 to the xth power                exp2(3) = 8
  469.     EXP10                 10 to the xth power              exp10(3) = 1000
  470.     FACT                  Factorial                         fact(5) = 120
  471.     LOG2                  Log base 2                        log2(8) = 3
  472.     LOG10                 Log base 10                    log10(100) = 2
  473.     LOG        LN         Natural log                       log(16) = 2.77
  474.     SGN        SIGN       Sign of expression                sgn(-9) = -1
  475.     SQR        SQRT       Square root                       sqr(64) = 8
  476.     
  477.     
  478.     6.  Order of Precedence
  479.         ===================
  480.     
  481.     Here is the precedence list from highest to lowest priority:
  482.     
  483.     Anything inside parenthesis is performed first  ( )
  484.     Factorial                                       !
  485.     Exponentiation                                  ^
  486.     Multiplication, division                        *, /
  487.     Modulo                                          MOD
  488.     Addition, subtraction                           +, -
  489.     Relational operators                            <, >, >=, <=, =, <>
  490.     AND
  491.     OR, XOR (exclusive or)
  492.     EQV (equivalence)
  493.     IMP (implication)
  494.     
  495.     When consecutive operators have the same priority, UCALC evaluates from
  496.     left to right.  This means that an expression such as "a-b-c" is
  497.     evaluated as "(a-b)-c".
  498.     
  499.     
  500.     7.  Flexible Syntax
  501.         ===============
  502.     
  503.     UCALC is designed to work in a simple and familiar way, and it
  504.     accommodates itself to several styles, so that users may start being
  505.     productive the very first time the program is executed.  Refer to 
  506.     '5.  Table of Symbols' for the alternative notations of several
  507.     operators and functions.  The entries below which are grouped together
  508.     are equivalent:
  509.     
  510.     ucalc> LOAD"myfile"   ; The interchangeability of the quote and
  511.     ucalc> LOAD myfile    ; parenthesis, or lack of either is also possible
  512.     ucalc> LOAD(myfile)   ; for MODE, FIX, DIG, AUTOCLR, and PREC.
  513.     
  514.     ucalc> SOLVE(x^2=100) ; The outer parenthesis can also be omitted in
  515.     ucalc> SOLVE x^2=100  ; WINDOW, INTEG, SUM, and SUMTABLE.
  516.     
  517.     ucalc> SUMTABLE(x, 1..10)       ; Any entry which uses '..' can
  518.     ucalc> SUMTABLE(x, 1 to 10)     ; also use ' TO ' instead.
  519.     ucalc> SUMTABLE x, 1 to 10
  520.     
  521.     ucalc> PLOT y=x^2               ; 'y=' can be omitted for these types
  522.     ucalc> PLOT x^2                 ; of graphic equations.
  523.     
  524.     ucalc> PLOT x=t, y=t^2, -5..5   ; 'x=' and 'y=' can be omitted
  525.     ucalc> PLOT t, t^2, -5..5
  526.     ucalc> PLOT t, t^2, -5 to 5
  527.     
  528.     
  529.     8.  GRAPHING
  530.         ========
  531.     
  532.     To see a demonstration of some of UCALC's graphing capabilities, enter
  533.     the following at the DOS prompt:
  534.     
  535.     PLOTDEMO
  536.     
  537.     Make sure that the PLOTDEMO.BAT, PLOTDEMO, and GRAPH.DAT files are in
  538.     the current directory.
  539.     
  540.     
  541.         8.1 How to Plot
  542.             -----------
  543.     
  544.     Syntax:      PLOT equation
  545.              or  PLOT
  546.     
  547.     This plots 2D user equations.  If an equation is entered on the same
  548.     line as the PLOT command, then it will be plotted.  If PLOT is entered
  549.     alone at the 'ucalc> ' command line, then the user will be asked to
  550.     enter several equations.  Press [return] twice when finished entering
  551.     equations.  Up to 16 user equations can be displayed simultaneously.
  552.     
  553.     NOTE:  Unlike expressions which are evaluated at the 'ucalc> ' prompt,
  554.            equations that are going to be plotted aren't checked for
  555.            certain errors.  Division by 0, square root of negative numbers,
  556.            etc... do not stop the graph from being plotted.
  557.     
  558.     Examples:
  559.     ---------
  560.     
  561.     ucalc> PLOT sin(x)
  562.     
  563.     ucalc> PLOT r=t/5
  564.     
  565.     ucalc> PLOT 2x+7
  566.     
  567.     ucalc> PLOT          ; PLOT by itself prompts for multiple equations
  568.     Equation 1: x^2           ; Plots a parabola
  569.     Equation 2: fill(1,3)     ; Fills an area bounded by the equation above
  570.     Equation 3: line(2,3,-1,5); Line segment from (2,3) to (-1,5)
  571.     Equation 4: r=t^2/pi      ; Polar equation
  572.     Equation 5: cos(t), sin(t); Parametric equation
  573.     Equation 6:
  574.     
  575.     After hitting [enter] on the blank line, it will plot the 5 entries
  576.     above.  Any combination of 2D equations can be entered.  The plotting
  577.     of an equation can be aborted at any time, by hitting any key.
  578.     
  579.     The following entries can be plotted:
  580.     
  581.     
  582.             8.1.1 Cartesian
  583.                   ---------
  584.     
  585.     Syntax:  y = f(x)   [,start..finish]           (or simply f(x))
  586.     
  587.     This plots a curve in the rectangular coordinate system (Cartesian). 
  588.     As a shortcut, the 'y=' can be omitted.  For instance, 'y=x^2' can
  589.     simply be entered as 'x^2'.  The variable parameter is 'x'.  Equations
  590.     can optionally be plotted within an interval defined by start & finish.
  591.     
  592.     Examples:
  593.     ---------
  594.     
  595.     PLOT y=tan(x)
  596.     
  597.     PLOT sin(x)-3
  598.     
  599.     PLOT 3cos(x), -pi to 2pi
  600.     
  601.     PLOT 3x^2-5x+1, 0..2        ; ('0..2' can also be written as '0 to 2')
  602.     
  603.     
  604.             8.1.2 Parametric
  605.                   ----------
  606.     
  607.     Syntax:  x = f(t), y = g(t) [,a..b]     (or simply f(t), g(t) [,a..b])
  608.     
  609.     Certain types of curves in the x-y plane cannot be expressed in the
  610.     form 'y=f(x)'.  Parametric equations are more flexible, and can even be
  611.     used as a superset of equations in the 'y=f(x)' form.  'y=f(x)' can be
  612.     expressed as 'x=t, y=f(t)'.   Equations in the form 'x=f(y)' can also
  613.     be entered as a parametric equation, in the form 'x=f(t), y=t'.  If the
  614.     optional interval is omitted, UCALC uses 0..2pi.
  615.     
  616.     Examples:
  617.     ---------
  618.     
  619.     ucalc> PLOT x= cos(t), y= t-2
  620.     
  621.     ucalc> PLOT cos(t), t-2     ; This is the same as above
  622.     
  623.     ucalc> PLOT cos(t)-1, sin(t)+t-5, 0..3pi
  624.     
  625.     ucalc> PLOT 2 cos(t), t, -5..5
  626.     
  627.     NOTE:  Remember that the variable parameter for parametric equations is
  628.            't' and not 'x'.
  629.     
  630.     
  631.             8.1.3 Polar
  632.                   -----
  633.     
  634.     Syntax: r = f(t) [,a..b]
  635.     
  636.     'r=' is what makes UCALC recognize that it's a polar equation, so 'r='
  637.     is not optional.  If the optional a..b interval is not entered, then
  638.     the default 0..2pi will be used.  The variable parameter for polar
  639.     equations is 't'.
  640.     
  641.     Examples:
  642.     ---------
  643.     
  644.     ucalc> PLOT r=t/pi, 0..10pi
  645.     
  646.     ucalc> PLOT r=sin(t)
  647.     
  648.     ucalc> PLOT r=t*sin(t)
  649.     
  650.     
  651.             8.1.4 3D Surface
  652.                   ----------
  653.  
  654.     Syntax:  y = f(x,z)   [,start..finish]           (or simply f(x,z))
  655.     
  656.     This plots a surface in 3D space.  As a shortcut, the 'y=' can be
  657.     omitted.  For instance, 'y=sin(x)*z' can simply be entered as
  658.     'sin(x)*z'.  The variable parameters are 'x' and 'z'.  Equations
  659.     can optionally be plotted within an interval defined by start & finish.
  660.     Graphs are plotted in the following xyz view point.
  661.  
  662.     y |
  663.       |  / z
  664.       | /
  665.        ------- 
  666.              x
  667.  
  668.     Examples:
  669.     ---------
  670.     
  671.     PLOT3D y=sin(x)*z
  672.     
  673.     PLOT3D sin(sqrt(x^2+z^2))*5
  674.     
  675.     PLOT3D sin(x), -5 to 5
  676.     
  677.  
  678.             8.1.5 Plotting data from another file
  679.                   -------------------------------
  680.     
  681.     Syntax:  "mygraph.dat"
  682.     
  683.     Graphs from a text file can be plotted by entering the name of the file
  684.     inside quotes.  The file must consist of a list of x and y coordinates
  685.     which are separated by spaces, or a comma.  The file may look something
  686.     like this:
  687.     
  688.     -10            .5440211108893698
  689.     -9            -.4121184852417566
  690.     -8            -.9893582466233818
  691.     -7            -.6569865987187891
  692.     etc...
  693.     
  694.     Examples:
  695.     ---------
  696.     
  697.     ucalc> PLOT"mygraph.dat"
  698.  
  699.     ucalc> PLOT
  700.     Equation 1: "mygraph.dat"
  701.     
  702.     
  703.             8.1.6 Line Segment
  704.                   ------------
  705.     
  706.     Syntax:  LINE(x1,y1,x2,y2)
  707.     
  708.     This produces a line segment with endpoints (x1,y1) and (x2,y2).
  709.     
  710.     Example:
  711.     --------
  712.     
  713.     ucalc> PLOT line(3,2,5,7)
  714.     
  715.     
  716.             8.1.7 Rectangle
  717.                   ---------
  718.     
  719.     Syntax:  RECT(x1,y1,x2,y2)
  720.     
  721.     This produces a rectangle which has opposing corners (x1,y1) and
  722.     (x2,y2).
  723.     
  724.     Example:
  725.     --------
  726.     
  727.     ucalc> PLOT rect(0,0,5,6)
  728.     
  729.     
  730.             8.1.8 Filling an Area
  731.                   ---------------
  732.     
  733.     Syntax:  FILL(x,y)
  734.     
  735.     This fills a bounded area on the screen in which (x,y) is located.  In
  736.     monochrome mode, it fills the area around (x,y) enclosed within any
  737.     other curve, or the edge of the screen.  If the graphs are in multiple
  738.     colors, then the FILL statement only uses the color of the preceding
  739.     graph as a boundary.  See the example in '8.1 Plotting'.
  740.     
  741.     
  742.         8.2 Graph menu
  743.             ----------
  744.     
  745.     When graphing is completed, a menu with function keys appears at the
  746.     top.  Due to limited space, the descriptions on screen are very brief.
  747.     Here is a more detailed explanation of each option.
  748.     
  749.     
  750.             8.2.1 [F2] Reset
  751.                   ----------
  752.     
  753.     This clears the screen, sets graphs to their original sizes, and then
  754.     replots them.
  755.     
  756.     
  757.             8.2.2 [F3] Fill
  758.                   ---------
  759.     
  760.     Move the cursor inside an enclosed area of the screen, and press F3. 
  761.     This will fill the enclosed area.  This works best in the MONO mode
  762.     (press F8 for MONO).
  763.     
  764.     
  765.             8.2.3 [F4] Color
  766.                   ----------
  767.     
  768.     1. When the cursor is in the free-floating mode (default) the
  769.        background color changes.
  770.     
  771.     2. If a graph is being traced, F4 will change the color of that graph.
  772.     
  773.     
  774.             8.2.4 [F5] Grid/Axis
  775.                   --------------
  776.     
  777.     This sets or removes the grid and axis lines for 2D graphs.  Press it
  778.     several times to cycle through the options.
  779.     
  780.     
  781.             8.2.5 [F6] Dot/Connect
  782.                   ----------------
  783.     
  784.     This toggle plots equations as connected curves, or with disconnected
  785.     dots.  When the precision is set high enough, dots are close together
  786.     and may seem connected.
  787.     
  788.     
  789.             8.2.6 [F7] Trace
  790.                   ----------
  791.     
  792.     This allows users to trace through polar, parametric, and y=f(x)
  793.     equations.  Use the right and left arrow keys (or mouse) to trace
  794.     through a graph.  Pressing F7 again will put the cursor back in the
  795.     free-floating mode.  Use the up or down arrow keys to choose the
  796.     previous or next equation.
  797.     
  798.     For a "y=f(x)" type of equation, tracing starts on the x coordinate of
  799.     the current cursor location.  For polar & parametric equations, tracing
  800.     starts at the origin, and additional coordinates are displayed.
  801.     
  802.     
  803.             8.2.7 [F8] Mono
  804.                   ---------
  805.     
  806.     Due to lack of space, this option is not displayed on the menu.  This
  807.     sets all the graphs to the same color, allowing the F3 FILL option to
  808.     work more effectively.  Pressing it a second time sets it back to color
  809.     again.
  810.     
  811.     
  812.             8.2.8 [F9] Zoom In
  813.                   ------------
  814.  
  815.     In order to zoom in on an area, place the cursor in the center of the
  816.     area of interest, and press F9 or the left mouse button.  The zoom
  817.     factor can be changed with the ZOOM command.
  818.  
  819.  
  820.             8.2.9 [F10] Zoom Out
  821.                   --------------
  822.  
  823.     This zooms out.  The right mouse button can also be used.
  824.  
  825.     
  826.         8.3 Special Graphing Commands
  827.             -------------------------
  828.     
  829.             The following commands can be entered at the 'ucalc> ' prompt,
  830.     or placed in the UCALC.DEF file:
  831.     
  832.     
  833.             8.3.1 AUTOCLR (automatic coloring)
  834.                   ----------------------------
  835.     
  836.     Syntax:  AUTOCLR [nn]
  837.     
  838.     This command causes each consecutive graph to be displayed in a
  839.     different color.  The optional 'nn' parameter indicates how many
  840.     different colors can be used.  The default is 15.  If some graphs turn
  841.     out to be invisible, then a smaller number should be chosen for 'nn'. 
  842.     The CGA and MCGA modes in UCALC do not support color.
  843.     
  844.     Examples:
  845.     ---------
  846.     
  847.     ucalc> AUTOCLR          ; Allows 15 different colors (default)
  848.     ucalc> AUTOCLR 3        ; Tells UCALC to use only 3 different colors
  849.     
  850.     
  851.             8.3.2 AXIS (sets axis line color)
  852.                   ---------------------------
  853.     
  854.     Syntax: AXIS color
  855.     
  856.     This sets the axis line color.  Color 0 turns the axis lines off.  It
  857.     can be toggled interactively in the graphic screen with F5.
  858.     
  859.     Examples:
  860.     ---------
  861.     
  862.     ucalc> AXIS 0    ; Turns the axis lines off.
  863.     ucalc> AXIS 1    ; Axis lines set to blue
  864.     
  865.     
  866.             8.3.3 CONNECT (toggle for dot/connect)
  867.                   --------------------------------
  868.     
  869.     Syntax:  CONNECT {ON | OFF}
  870.     
  871.     When CONNECT is OFF, graphs will be drawn as a series of dots, as
  872.     opposed to a continuously connected curve.  A dot graph is better for
  873.     plotting certain discontinuous graphs, such as "y=INT(x)".  When in the
  874.     graphic screen, F6 will interactively toggle the connect option.
  875.     
  876.     Example:
  877.     --------
  878.     
  879.     ucalc> CONNECT OFF
  880.     
  881.     
  882.             8.3.4 GCOLOR (background color in graphic mode)
  883.                   -----------------------------------------
  884.     
  885.     Syntax:  GCOLOR color
  886.     
  887.     This sets the background color on the graphic screen.  In the VGA mode,
  888.     a number between 0 and 63 is accepted.  The graphic color can also be
  889.     changed interactively by pressing F4 in the graphic screen.
  890.     
  891.     Example:
  892.     --------
  893.     
  894.     ucalc> GCOLOR 10
  895.     
  896.     
  897.             8.3.5 GRID (sets grid color & pattern)
  898.                   --------------------------------
  899.     
  900.     Syntax:  GRID color [,pattern]
  901.     
  902.     This command sets the color and pattern of the grid that will be used
  903.     in the graphic screen.  In order for the grid not to appear, set GRID
  904.     to 0.  The optional "pattern" parameter sets a pattern for the line. 
  905.     The default is #b1000100010001000
  906.                      .   .   .   .   .   .   .   .   .   .
  907.     As illustrated with the dots above, this represents a pattern with each
  908.     1 corresponding to a pixel (the pixel dots are of course much closer
  909.     together in the graphic screen).  A pattern of -1 makes it a continuous
  910.     line.  The grid can be toggled on or off interactively with F5.
  911.     
  912.     Example:
  913.     --------
  914.     
  915.     ucalc> GRID 4                      ; Sets a grid with color 4
  916.     ucalc> GRID 1, #b1010101010101010  ; Sets a dotted grid with every
  917.                                        ; other pixel turned on
  918.     ucalc> GRID 5, -1                  ; -1 makes it a continuous line
  919.     
  920.     
  921.             8.3.6 MODE (selects graphic card)
  922.                   ---------------------------
  923.     
  924.     Syntax:  MODE {CGA | EGA | HGC | VGA | MCGA}
  925.     
  926.     This changes the graphic mode that is used for plotting.  When UCALC
  927.     loads up, it automatically determines the highest resolution supported
  928.     by your computer.  To change it to another screen mode, put a MODE
  929.     statement in UCALC.DEF (or type it at the 'ucalc> ' prompt), with the
  930.     proper selection.
  931.     
  932.     Example:
  933.     --------
  934.     
  935.     ucalc> MODE EGA               ; Sets the monitor to EGA mode
  936.     
  937.  
  938.             8.3.7 MONO (turns colors off)
  939.                   -----------------------
  940.  
  941.     Syntax:  MONO
  942.  
  943.     This turns all colors off in the graphic mode.  Those who do not have a
  944.     color monitor may want to include this command in UCALC.DEF.  This
  945.     command may also be useful for a better printout, or when filling the
  946.     area between graphs.
  947.  
  948.  
  949.             8.3.8 PLOTF (sends the graph coordinates to a file)
  950.                   ---------------------------------------------
  951.  
  952.     Syntax:  PLOTF"filename"
  953.  
  954.     This sends all the coordinates of the next 2D graph to the specified
  955.     file.  Follow this command with the PLOT or PPLOT command.
  956.  
  957.  
  958.             8.3.9 PPLOT (edits previously plotted equations)
  959.                   ------------------------------------------
  960.  
  961.     Syntax:  PPLOT
  962.  
  963.     In order to modify a few things in a set of equations that have been
  964.     plotted before, use the PPLOT command at the 'ucalc> ' prompt to avoid
  965.     retyping everything.  Sometimes you may want to simply change a setting
  966.     such as the zoom factor or graph precision, and plot the previous set
  967.     of equations without modification.  In this case, type "PLOT" and press
  968.     [enter] twice.
  969.  
  970.     Examples:
  971.     ---------
  972.  
  973.     ucalc> PPLOT     ; This lets you modify previously graphed equations.
  974.     ucalc> PLOT
  975.     Equation 1:      ; Press [enter] without typing an equation to replot
  976.                        the previous set, if no modifications are desired.
  977.  
  978.  
  979.             8.3.10 Graphing precision (PREC)
  980.                    -------------------------
  981.  
  982.     Syntax:  PREC nn
  983.  
  984.     This changes the precision used in graphing.  'nn' represents the
  985.     number of pixels per unit (x-axis).  The higher 'nn' is, the higher the
  986.     precision will be.  More precision naturally means slower plotting.
  987.     The default precision is 10, and should be fine for many graphs.  If
  988.     stray lines appear in an unbounded graph, or if the graph appears
  989.     jagged, or if the curve doesn't quite reach the starting or ending
  990.     points (such as in polar graphs) then raising the precision will often
  991.     solve the problem.
  992.  
  993.     Example:
  994.     --------
  995.  
  996.     ucalc> PREC 100
  997.  
  998.  
  999.             8.3.11 WINDOW (sets screen coordinate system)
  1000.                    --------------------------------------
  1001.  
  1002.     Syntax:  WINDOW(x1,x2,y1,y2)
  1003.  
  1004.     This modifies the graphic screen coordinate system.  x1 and x2
  1005.     represent the screen end locations of the X axis, and the Y axis goes
  1006.     from y1 to y2.  The X and Y axes cross at (0,0).  The default setting
  1007.     is WINDOW(-10,10,-7.5,7.5), which means that the origin (0,0) is at the
  1008.     center of the screen, with point (-10,-7.5) at the bottom left of the
  1009.     screen and (10,7.5) at the top right of the screen.
  1010.  
  1011.     Examples:
  1012.     ---------
  1013.  
  1014.     ucalc> WINDOW(0,10,0,7.5)
  1015.     This sets the origin at the bottom left of the screen.
  1016.  
  1017.     ucalc> WINDOW(-1,1,-1,1)
  1018.     The origin is at the center, and x goes from -1 to 1, and so does y.
  1019.  
  1020.     ucalc> WINDOW(-10,10,-7,7)
  1021.     This creates a better proportional window in the EGA mode.
  1022.  
  1023.  
  1024.             8.3.12 ZOOM (changes zoom factor)
  1025.                    --------------------------
  1026.  
  1027.     Syntax: ZOOM factor
  1028.  
  1029.     This sets the zoom factor.  The default is 5.  When a graph is on the
  1030.     screen, place the cursor on an area that you want to magnify.  Press F9
  1031.     to zoom in, or F10 to zoom out.
  1032.  
  1033.     Examples:
  1034.     ---------
  1035.  
  1036.     ucalc> ZOOM 10   ; When you later press the Zoom In key, the image
  1037.                      ; will be magnified 10 times.
  1038.  
  1039.  
  1040.         8.4 Moving the Crosshair
  1041.             --------------------
  1042.  
  1043.     For mouseless systems, after the graphs have been plotted, a crosshair
  1044.     (graphic cursor) is placed at the upper left hand corner of the screen.
  1045.     It can be moved with the arrow keys in order to pinpoint coordinates on
  1046.     the screen.  The Home, End, PgUp, and PgDn keys can also be used, for
  1047.     diagonal movement.  To move the crosshair slowly, press the key and
  1048.     release it quickly.  To move it faster, hold the key down as it
  1049.     accelerates.  A mouse can be used to move the mouse pointer.
  1050.     
  1051.     
  1052.         8.5 Adding Text to the Screen
  1053.             -------------------------
  1054.     
  1055.     To add text on the graphic screen, simply start typing wherever the
  1056.     crosshair cursor (or mouse pointer) is located.
  1057.     
  1058.     
  1059.         8.6 Printing a Graphic Screen
  1060.             -------------------------
  1061.     
  1062.     For DOS users, in order to be able to send graphs to the printer, run
  1063.     GRAPHICS.COM (which comes with DOS) before loading UCALC.  Then, when a
  1064.     graph is on the screen, press the 'Print Screen' key to send it out to
  1065.     the printer.  For better results on printers which do not support color,
  1066.     issue the MONO command at the 'ucalc> ' prompt before plotting.  See the
  1067.     DOS manual for more details on GRAPHICS.COM.  This version of UCALC has
  1068.     no built-in mechanism for printing.
  1069.  
  1070.     NOTE: Windows 95 users may press ALT ENTER to downsize the graph, and
  1071.           cut the desired portion of the screen, and past it into a word
  1072.           processor.
  1073.     
  1074.     
  1075.     9.  Summation
  1076.         =========
  1077.     
  1078.     Syntax:  SUM fx, a..b [,dx]
  1079.     
  1080.          b
  1081.         ____
  1082.         \    f(x)    is written as 'SUM f(x), a..b', where f(x) is your
  1083.         /___         function, and a..b is the range.
  1084.         x= a         The summation cannot be part of another expression.
  1085.     
  1086.     The optional  dx  parameter can be used in order to indicate an
  1087.     increment other than the default 1.
  1088.     
  1089.     Examples:
  1090.     ---------
  1091.     
  1092.     ucalc>   sum x^2+2*x+14, 5..1000
  1093.     Answer:  334848394
  1094.     
  1095.     ucalc>   sum x^3-2, 1..15, .1
  1096.     Answer:  127971.6
  1097.     
  1098.     SUMTABLE is the same as SUM, except that intermediate values are
  1099.     displayed as the sum is being added.
  1100.     
  1101.     ucalc>  sumtable x^2/fact(x), 1..3
  1102.        Count         Value         Cumulative
  1103.        1             1             1
  1104.        2             2             3
  1105.        3             1.5           4.5
  1106.     
  1107.     Answer:  4.5
  1108.     
  1109.     A long list can be aborted with the [Esc] key.
  1110.     
  1111.     
  1112.     10. Numerical Integration
  1113.         =====================
  1114.     
  1115.     Syntax:  INTEG fx,a..b [,n]
  1116.     
  1117.     This approximates the value for the definite integral of fx, using
  1118.     Simpson's rule.  This rule requires that  n  be an even number.  UCALC
  1119.     takes care of that by automatically transforming  n  to the next
  1120.     highest even number (n = n + n mod 2).  If no value for n is given,
  1121.     then 100 is used as the default number of subdivisions.  This command
  1122.     works properly only when fx is a continuous function.  INTEG cannot be
  1123.     part of another expression.
  1124.     
  1125.     Examples:
  1126.     ---------
  1127.     
  1128.     ucalc>   integ x*sin(x), 0..pi
  1129.     Answer:  3.14159267059288459
  1130.     
  1131.     ucalc>   integ 1-x^2, 0..1, 8 
  1132.     Answer:  .666666666666666667
  1133.     
  1134.     
  1135.     11. Solving Equations
  1136.         =================
  1137.     
  1138.     Syntax:  SOLVE fx [=gx] [,a..b]
  1139.  
  1140.     This solves an equation for the value of 'x'.  The statements in
  1141.     brackets are optional.  If the expression on the right of the = sign is
  1142.     0, then you can simply do:  'SOLVE expression'.  For instance,
  1143.     'SOLVE 3*x+2=0 can be written as SOLVE 3*x+2.  If the equation happens
  1144.     to have several solutions, you can indicate the interval (a..b) of the
  1145.     particular solutions you are interested in.
  1146.  
  1147.     The algorithm used in this program for solving equations is the
  1148.     Bisection Method, which is a special case of the Intermediate Value
  1149.     Theorem.  A solution can be found for continuous functions in the
  1150.     interval a < x < b, where f(a) < 0 < f(b).  If a..b is not defined,
  1151.     then the default interval is from -1E6 to 1E6.  If a real solution does
  1152.     exist, but cannot be found with the default interval, then try
  1153.     narrowing the interval as much as possible.
  1154.  
  1155.     Examples:
  1156.     ---------
  1157.  
  1158.     ucalc>   solve exp(x+x^2)-sqr(x+5) = 127
  1159.     Answer: -2.75962472778054749
  1160.     Answer:  1.76151609179570087
  1161.  
  1162.     ucalc>   solve sin(x)=cos(x), 0..pi
  1163.     Answer:  .78539816339744831
  1164.  
  1165.     ucalc>   solve x^3+2*x+5 = 10+7
  1166.     Answer:  2
  1167.  
  1168.     ucalc>   solve 2*x^2-3
  1169.     Answer: -1.22474487139158905
  1170.     Answer:  1.22474487139158905
  1171.     
  1172.     
  1173.     12. Numerical Notations
  1174.         ===================
  1175.     
  1176.     The default numerical type is DECIMAL.  Binary, octal, and hexadecimal
  1177.     number types are also supported.  The latter types must be preceded by
  1178.     the  #  (number sign) symbol, and one of the letters "h", "b", or "o",
  1179.     for hexadecimal, binary, or octal in that respective order.  The $ sign
  1180.     for hexadecimal notation can be used as a shortcut.  See examples.
  1181.     
  1182.     In order to see all your answers in hex, binary, and octal, issue the
  1183.     command:  mode HBO
  1184.     
  1185.     Exponential notation is also supported.  These are numbers followed by
  1186.     the letter E, and an exponent number.  For instance:  3.4E+5 translates
  1187.     to 3.4*10^5, and 3.4E-5 translates to 3.4*10^(-5).
  1188.     
  1189.     Examples:
  1190.     ---------
  1191.     
  1192.     #b110101110,   #o656,   #h1AE,   $1AE,   430,   4.3E2
  1193.     are all the same number.
  1194.     
  1195.     #b10101^2 * 5/$1EF + sin(5.8+2)*cos(#o302)-7E6  is a valid expression.
  1196.     
  1197.     
  1198.     13. Implicit Multiplication
  1199.         =======================
  1200.     
  1201.     When writing math expressions, it is common to omit the times symbol
  1202.     (*), when multiplication is implied.  For instance, one may write
  1203.     '2x+5', which is the same as '2*x+5'.  The following are examples of
  1204.     implied multiplications supported by UCALC.
  1205.     
  1206.     Expression                    Equivalent
  1207.     ----------                    ----------
  1208.     x y                           x*y
  1209.     3pi+10                        3*pi+10
  1210.     5(4+8)                        5*(4+8)
  1211.     (5+5)(3+9)                    (5+5)*(3+9)
  1212.     (3+2)8                        (3+2)*8
  1213.     
  1214.     NOTE:  Implicit multiplication has the same priority as regular
  1215.            multiplication.  For instance '1/2q' is the equivalent of
  1216.            '1/2*q' not '1/(2q)'.  (This is subject to change in a future
  1217.            version).
  1218.     
  1219.     
  1220.     14. Assigning Variables
  1221.         ===================
  1222.     
  1223.     Variables can be used to store values, which can later become part of
  1224.     an expression.  Variables are composed of letters of the alphabet, and
  1225.     may contain numerical digits, as long as a numerical digit is not the
  1226.     first character.  A variable can be up to 1024 characters long.
  1227.     
  1228.     Examples:
  1229.     ---------
  1230.     
  1231.     mynumber = 12345
  1232.     mass = 15
  1233.     speed = 23+10.5
  1234.     m1 = 10*pi^2
  1235.     cb26 = sqrt(37) + mynumber
  1236.     
  1237.     
  1238.     15. Assigning Functions
  1239.         ===================
  1240.     
  1241.     Once defined, a user function behaves in the same way as a built-in
  1242.     function.  Argument names used in defining functions are temporary, and
  1243.     do not affect user variables with the same name.  The name of the
  1244.     function itself, however, should be unique.  The naming convention of
  1245.     functions is similar to that of variables.  User functions can accept
  1246.     many arguments.
  1247.     
  1248.     Examples:
  1249.     ---------
  1250.     
  1251.     cube(x) = x^3
  1252.     area(r,h) = pi*r*sqr(r^2+h^2)  ; area of right circular cone
  1253.     logx(base,num) = ln(num) / ln(base)
  1254.     abc(x,y,z) = 5 + logx(x,y)*z
  1255.     
  1256.     
  1257.     16. Miscellaneous Commands
  1258.         ======================
  1259.     
  1260.         16.1 LOAD command
  1261.              ------------
  1262.     
  1263.     Syntax:  LOAD"filename"
  1264.     
  1265.     This command loads up the contents of a file into the UCALC workspace.
  1266.     The file may contain any UCALC command.  A file saved with the WRITE
  1267.     command however, cannot be loaded directly if it contains 'ucalc> '
  1268.     prompts.
  1269.     
  1270.     Examples:
  1271.     ---------
  1272.     
  1273.     ucalc> load"convert.def"
  1274.     ucalc> load"finance.def"
  1275.     ucalc> load"formula.asc"
  1276.     
  1277.     
  1278.         16.2 WRITE command
  1279.              -------------
  1280.     
  1281.     Syntax:  WRITE"filename"
  1282.     
  1283.     This command records your UCALC session to the file name that you
  1284.     specify.  Everything that is displayed on the screen will go to that
  1285.     file verbatim, until you issue the CLOSE command, or exit.  If the file
  1286.     already exists, the WRITE command will append to it without removing
  1287.     what is already in the file.
  1288.     
  1289.     Example:
  1290.     --------
  1291.     
  1292.     ucalc> write"ucalc.log"
  1293.     
  1294.     
  1295.         16.3 SHELL command
  1296.              -------------
  1297.     
  1298.     Syntax:  SHELL
  1299.     
  1300.     This allows you to drop to DOS temporarily.  To resume your session,
  1301.     type EXIT at the DOS prompt.  [F4] does the same thing as the SHELL
  1302.     command.  You may also pass a command for DOS to execute.
  1303.     
  1304.     Examples:
  1305.     ---------
  1306.     
  1307.     ucalc> shell"dir"     ; This executes the DIR command.
  1308.     ucalc> shell          ; This drops you to DOS until you type EXIT.
  1309.     
  1310.     NOTE:  The SHELL command cannot be used in TSR mode.
  1311.     
  1312.     
  1313.         16.4 COLOR (text color)
  1314.              ------------------
  1315.     
  1316.     Syntax:  COLOR [foreground] [,background]
  1317.     
  1318.     The foreground and background colors of the text screen can be set at
  1319.     the 'ucalc> ' prompt (or in UCALC.DEF) with this command.  On color
  1320.     monitors, the foreground color can be a number between 0 and 31. 
  1321.     Background colors can be between 0 and 7.  UCALC also clears the screen
  1322.     when this command is entered.  See a DOS or programming manual for
  1323.     color values.
  1324.     
  1325.     Examples:
  1326.     ---------
  1327.     
  1328.     ucalc> COLOR 7,1           ; sets the screen to white over blue
  1329.     ucalc> COLOR 11,0          ; light cyan over black
  1330.     ucalc> COLOR 5             ; changes only the foreground
  1331.     ucalc> COLOR ,3            ; changes only the background
  1332.     
  1333.     
  1334.         16.5 REDIRECT
  1335.              --------
  1336.     
  1337.     Syntax:  REDIRECT {ON|OFF}
  1338.     
  1339.     Turning redirection off allows text to be displayed on the screen
  1340.     faster.  Also, the color statement may work better when redirection is
  1341.     off, depending on your screen configuration.  By default, UCALC
  1342.     redirection is ON if UCALC is executed from DOS, and OFF when UCALC is
  1343.     loaded as a TSR.
  1344.     
  1345.     
  1346.     17. UCALC.DEF
  1347.         =========
  1348.     
  1349.     Commonly used constants & functions, such as e, and logx(x,y) and any
  1350.     others that are used regularly, and start-up settings, such as COLOR,
  1351.     and PROMPT, etc... can be defined in UCALC.DEF.  This file can be
  1352.     created or modified with any ASCII text editor.  The semicolon (;) can
  1353.     be used as a remark.  Anything following it will be ignored.
  1354.     
  1355.     Every time UCALC is run, it looks for UCALC.DEF in the current
  1356.     directory first.  If it's not found there, it searches the directory
  1357.     which UCALC.EXE was loaded from.  If the file is found, its functions
  1358.     and variables are loaded.  The /NODEF option at the command line is
  1359.     equivalent to not having a UCALC.DEF file.
  1360.     
  1361.     Here is an example of what UCALC.DEF may look like:
  1362.     
  1363.     color 11,1
  1364.     grid 3,#b10101
  1365.     mode HBO
  1366.     window(-10,10,-7,7)
  1367.     load"convert.def"
  1368.     prompt""             ; Removes the default 'ucalc> ' prompt
  1369.     prompta"A:"          ; Replaces the default 'Answer: ' prompt with 'A:'
  1370.     
  1371.     e       = 2.718281828459045  ;  Natural log constant
  1372.     gravity = 9.8                ;  Acceleration due to gravity
  1373.     na      = 6.0221367E+23      ;  Avogadro's number 1/mol
  1374.     
  1375.     logx(base,num) = log(num) / log(base)
  1376.     
  1377.     A total maximum of 300 variables, and 200 user functions can be defined
  1378.     (and usually much less in TSR mode).
  1379.     
  1380.     
  1381.     18. Technical Notes
  1382.         ===============
  1383.     
  1384.     o UCALC is not case sensitive.  Upper case letters are treated just the
  1385.       same as lower case letters.  For instance, pi, PI, and Pi are all
  1386.       treated the same.
  1387.     
  1388.     o Rounding:  The rounding method in UCALC is called banker's rounding. 
  1389.       With this method, numbers ending with the digit 5 are rounded towards
  1390.       the closest even digit.  For instance, both 11.5 and 12.5 are rounded
  1391.       to 12, and both 13.5 and 14.5 are rounded to 14, when FIX is set to
  1392.       0.  Only the displayed number is rounded, while the actual
  1393.       calculations are always performed in high precision.
  1394.     
  1395.     o Random Numbers:  The RND function produces a random number between 0
  1396.       and 1.  RND(1) returns a new random number each time it is used. 
  1397.       RND(0) returns the previously used random number.  If x is negative,
  1398.       then RND(x) returns a predictable number.  For instance, RND(-5) will
  1399.       produce the same number each time.  To get a random number between 0
  1400.       & x, simply use RND(1)*x.  For instance, RND(1)*50 will return a
  1401.       random number between 0 & 50.
  1402.     
  1403.     o Ugly Numbers:  Occasionally, numbers are not displayed as one might
  1404.       expect.  For instance you might get .499999999999999999 instead of
  1405.       .5, or 8.23423423982432343E-18 instead of 0, which is actually pretty
  1406.       close to the answer.  This may happen as a result of lengthy
  1407.       operations, or certain types of functions.  One solution is to reduce
  1408.       the number of decimal digits that are displayed with the FIX command.
  1409.     
  1410.     o HBO mode:  When this mode is on, it will display the hex, binary, and
  1411.       octal notations, only for values between -32766 and 65535.  Numbers
  1412.       beyond that range are displayed only in decimal form.  Negative
  1413.       numbers are represented in "two's complement" form.  Only the integer
  1414.       part of a number is displayed in hex, bin, and oct.  Entering 'MODE
  1415.       HBO' turns the HBO mode on.  Typing it again turns it back off.
  1416.     
  1417.     o Relational operators return a 1 for true expressions, and 0 for false
  1418.       ones.  For instance,  '5 > 3' returns 1, and '5 < 3' returns 0.
  1419.     
  1420.     o Compound Functions:  Functions with multiple entries may be defined
  1421.       by using relational operators.  For instance:
  1422.     
  1423.                 / 2+x^2,   x > 0
  1424.         f(x) = |  3,       x = 0
  1425.                 \ x*2+8,   x < 0
  1426.     
  1427.        can be written as:
  1428.     
  1429.         f(x) = (2+x^2)*(x > 0)  +  (3)*(x = 0)  +  (x*2+8)*(x < 0)
  1430.     
  1431.     o Equal Sign:  The single equal sign, =, can be used both for assigning
  1432.       functions & variables, and as a relational operator.  If there is a
  1433.       conflict in the logic of an expression such that it can be taken
  1434.       either way, then use the double equal sign, ==, when a relational
  1435.       operator is intended.  An assignment is assumed only when the
  1436.       expression left of the left-most equal sign is a valid function or
  1437.       variable name.  To avoid all confusion, use == for relational
  1438.       operations.
  1439.     
  1440.     o Limited Function Space:  There is a limit of instructions (such as +,
  1441.       -, *, etc...) which can be used for defining functions.  Every time a
  1442.       function is defined or redefined, part of the instruction list is
  1443.       filled, and cannot be reclaimed during a UCALC session.  An error
  1444.       message is given when too many functions have been defined.
  1445.     
  1446.     o Each expression can use a maximum of 33 instructions.  If an
  1447.       expression is too long, UCALC returns an error message.  Expressions
  1448.       can be broken down into several shorter ones.
  1449.     
  1450.     o The graphic screen is optimized for the VGA mode.  With lower
  1451.       resolution, the crosshair will give a less accurate reading of its
  1452.       location on the screen.  WINDOW(-10,10,-7,7) is a better match for
  1453.       the proportions of the EGA screen mode.
  1454.     
  1455.     o UCALC can be de-activated from memory with the command "EXIT TSR". 
  1456.       However, in order for UCALC to be able to remove itself successfully
  1457.       from memory, UCALC should be the last TSR to be loaded, and the
  1458.       unloading should take place when UCALC is popped up at the DOS
  1459.       prompt.
  1460.     
  1461.     o End-of-file:  When doing redirection from the DOS command line, make
  1462.       sure that the input file ends with an end-of-file marker (^Z, or
  1463.       ASCII 26).  Many text editors take care of this automatically, but a
  1464.       few don't.  An input file may alternatively end with a ^C (ASCII 3)
  1465.       or the EXIT command.  Be sure to add several blank lines at the end
  1466.       of the input file.  An input file with no ^C, ^Z or EXIT, and no
  1467.       blank lines at the end may cause UCALC to freeze.
  1468.     
  1469.     o Redirection mode is forced off when UCALC is loaded as a memory
  1470.       resident program.  If the REDIRECT ON command is manually issued when
  1471.       in TSR mode, UCALC may crash when popping down.  This will hopefully
  1472.       be changed in a future version.
  1473.     
  1474.     
  1475.     19. Registration
  1476.         ============
  1477.     
  1478.     You are granted a 30 day period for evaluating UCALC.  Continued usage
  1479.     of this program beyond this trial period requires payment of a
  1480.     registration fee to the author.  The fee is only $25 for one person,
  1481.     or less per unit (see UCALCREG.DOC) when purchasing a site license for
  1482.     use on several computers.  Continued development of this program
  1483.     depends on users like you who pay for it.
  1484.     
  1485.     Registered users receive a special code that permanently deactivates
  1486.     all registration reminders.  Notice that there is no extra shipping
  1487.     charge in this version because of this, even for international users.
  1488.     
  1489.     In order to help me better support this program, please answer the
  1490.     questions in QUEST.DOC, whether you decide to register or not.  This
  1491.     will allow me to keep the price down, and add the right features in the
  1492.     next version.  Use the form in UCALCREG.DOC to place your registration.
  1493.     
  1494.     Easy Service
  1495.     ------------
  1496.     For your convenience, you can order UCALC from the Public Software
  1497.     Library with your Visa, Master Card, American Express, or Discover card
  1498.     by calling toll-free at 1-800-242-4PSL (overseas: 713-524-6394) or by
  1499.     FAX to 713-524-6398, and even by Compuserve at 71355,470.  PSL NUMBERS
  1500.     ARE FOR ORDERING ONLY.  I cannot be reached through PsL.  To reach me
  1501.     personally, call 305-233-2604, or send e-mail at Dancorbier@aol.com
  1502.     (or corbier@satelnet.org).  The PsL part number for UCALC is 10655.
  1503.  
  1504.     Compuserve users can register by typing GO SWREG, and choosing
  1505.     registration ID: 3591.
  1506.     
  1507.     Support
  1508.     -------
  1509.     I will try to extend my support to unregistered users during their
  1510.     evaluation period, however, I reserve the right to limit this support.
  1511.     The preferred method of communication is via e-mail whenever possible.
  1512.     See section 21 for other ways of reaching the author.
  1513.     
  1514.     License
  1515.     -------
  1516.     For this license agreement, a site is considered to be any corporation,
  1517.     institution, government agency, computer lab, or non-personal
  1518.     organization, with more than one computer capable of running the UCALC
  1519.     software.
  1520.     
  1521.     A site may use the unregistered version for evaluation purposes only. 
  1522.     If the site decides to continue using UCALC after 30 days, a site
  1523.     license must be purchased.  The site license arrangement provides for
  1524.     volume discounts.  See the file named UCALCREG.DOC for the low rates
  1525.     that are available.
  1526.     
  1527.     A site license is for use of the software within your site, and is not
  1528.     transferable.  This license allows the internal use and copying of the
  1529.     software by as many computers as contracted for.  Distribution,
  1530.     repackaging, or reselling of the licensed version to third parties is
  1531.     not allowed under this agreement.  The unregistered version however may
  1532.     be freely distributed, as long is it contains all original files, in
  1533.     unmodified form.
  1534.     
  1535.     The LICENSER (Daniel Corbier) warrants that he is the sole owner of the
  1536.     UCALC software and has full power and authority to grant this license
  1537.     herein without consent of any other party.
  1538.     
  1539.     Disclaimer
  1540.     ----------
  1541.     The Ultimate Calculator (UCALC) is provided on an "as is" basis without
  1542.     warranty of any kind, expressed or implied.  The person using the
  1543.     software bears all risk as to the quality and performance of the
  1544.     software.  The author will not be held liable for any special,
  1545.     incidental, consequential, direct or indirect damages due to any
  1546.     malfunctions.
  1547.     
  1548.     Aside from the legal stuff, I'm eager to support this program as much
  1549.     as possible.  I want to hear your suggestions for the next release.
  1550.     
  1551.     
  1552.     20. Shareware Author & User Case Study
  1553.         ==================================
  1554.     
  1555.     In the process of developing UCALC, and searching for ways to make it
  1556.     profitable, I did some research to find the right ingredients for
  1557.     getting people to pay for shareware programs they use.  So, I conducted
  1558.     a survey asking many shareware users what motivates them to register.
  1559.     I also asked a number of well-known successful shareware authors what
  1560.     they have done to receive many registrations.  The results are written
  1561.     in a document which can be found in many online places.  Here's the
  1562.     description:
  1563.     
  1564.     Filename:  SAUCS1.ARJ (or .ZIP, .LZH, .SDN, ..)
  1565.  
  1566.     Description:   SHAREWARE AUTHOR & USER CASE STUDY v1 - Answers
  1567.                    questions that shareware authors often ask, such as what
  1568.                    motivates users to register, what prevents them from
  1569.                    doing so, how much they are willing to pay, how to get
  1570.                    one's program "out there", whether or not crippling and
  1571.                    nagging works, how long users take to evaluate programs
  1572.                    before paying, etc ...  Answers are based on survey
  1573.                    responses from shareware users and successful authors.
  1574.     
  1575.     Size:  42k (when compressed with ARJ)
  1576.     
  1577.     
  1578.     21. My Address
  1579.         ==========
  1580.     
  1581.     For information about dealer pricing, volume discounts, site licensing,
  1582.     latest versions, suggestions, or for technical information, you can
  1583.     contact me through one of the following means:
  1584.     
  1585.     US Mail:
  1586.         Daniel Corbier
  1587.         20410 SW 92 Place
  1588.         Miami, FL  33189
  1589.  
  1590.     FAX: 305-233-2604
  1591.  
  1592.     Voice: 305-233-2604
  1593.     
  1594.     Internet:
  1595.         Dancorbier@aol.com
  1596.         (or corbier@satelnet.org, or corbier@delphi.com)
  1597.     World Wide Web (WWW):
  1598.         http://members.aol.com/Dancorbier/ucalc.html
  1599.     
  1600.     Fidonet:
  1601.         Daniel Corbier at 1:135/110
  1602.     
  1603.     Compuserve: 75541,1523
  1604.     
  1605.     The following addresses can also be used from Compuserve:
  1606.     INTERNET:  Dancorbier@aol.com
  1607.     (or INTERNET:  corbier@satelnet.org)
  1608.         
  1609.     I try my best to answer all e-mail inquiries.  Sometimes e-mail can get
  1610.     lost.  If several days pass without a response, please try sending e-
  1611.     mail to another listed address.  Your messages are important.
  1612.     
  1613.     
  1614.     22. Distribution
  1615.         ============
  1616.     
  1617.     You are encouraged to distribute the shareware version of UCALC.  The
  1618.     following files must all be present and unmodified when distributed:
  1619.     
  1620.     UCALC.DEF     Sample UCALC.DEF file
  1621.     UCALC.TSR     Options for TSR mode
  1622.     UCALC.EXE     Executable
  1623.     UCALC.DOC     Documentation
  1624.     QUEST.DOC     Questionnaire
  1625.     HISTORY.DOC   Lists the features that were added in each version
  1626.     EXAMPLES.DOC  Examples for UCALC
  1627.     UCALCREG.DOC  Registration form
  1628.     PLOTDEMO      Demo of equations that UCALC can plot
  1629.     PLOTDEMO.BAT  Graphing demo batch file
  1630.     GRAPH.DAT     Sample coordinate data file for the graphic demo
  1631.     CONVERT.DEF   Conversion functions
  1632.     SDN.ID        Description for the Shareware Distribution Network (SDN)
  1633.     FILE_ID.DIZ   Brief program description for bulletin boards
  1634.     
  1635.     The compressed file name prefix must be UCALC32 or UCAL32 or UCALC
  1636.     (followed by ARJ, ZIP, LZH, or other).
  1637.     
  1638.     Vendors
  1639.     -------
  1640.     Vendors may distribute UCALC, as long as it is not labeled "free",
  1641.     "cheap", "copyright free", or "public domain".  It must be made clear
  1642.     to customers that this program is shareware, and that a payment must be
  1643.     made to the author if they continue using it.  All ASP distributors in
  1644.     good standing may distribute the Ultimate Calculator without my written
  1645.     permission (although I would appreciate a copy of your catalog).
  1646.     
  1647.     Vendors who operate with good business ethics should feel free to
  1648.     distribute UCALC without my written permission.
  1649.     
  1650.  
  1651.     23. Acknowledgments
  1652.         ===============
  1653.     
  1654.     I would like to thank those who have registered UCALC, and everyone who
  1655.     has sent suggestions.  I would like to thank Dr. Steven Gunhouse for
  1656.     suggestions on graphic features such as zoom, trace, etc....  I would
  1657.     also like to thank the following people for being beta testers:
  1658.     
  1659.     Aaron Beharrell
  1660.     Jonathan Borwein   University of Waterloo
  1661.     David G. Caraballo Princeton University
  1662.     Elan Feingold      Cornell University
  1663.     Daryl Gungadoo     Andrews University
  1664.     Steven Gunhouse    University of Texas
  1665.     James Hague
  1666.     Rich Holland       Kansas State University
  1667.     Fred Hapgood
  1668.     John Lim Eng Hooi
  1669.     Willie Hutton      University of Colorado
  1670.     Mark W Jacobs      Stanford University
  1671.     Michael D. Lawler  Ball State University
  1672.     Chris Long         Rutgers University
  1673.     Mark E. Mallett
  1674.     Peter Paul Meiler  TNO Physics & Electronics Lab, the Netherlands
  1675.     Marty Milette      Mitel Corporation
  1676.     Matt Pardo         North Carolina Medical Center
  1677.     Alexander Pruss    University of British Columbia
  1678.     Glauber Ribeiro    O.C. International, Brazil
  1679.     Dave Sklar         Temple University
  1680.     John Steele        Video Business Systems
  1681.     David Steinman     University of Toronto
  1682.     Sue Widemark
  1683.     Shi-Chang Wooh     Northwestern University, Illinois
  1684.     
  1685.                     <<<<  END OF UCALC DOCUMENTATION  >>>>
  1686.